home *** CD-ROM | disk | FTP | other *** search
- In a message of 30 Jan 96 Tony Syslo wrote to All:
-
- TS> char name[80];
- [...]
- TS> name="";
-
- It doesn't work quite like this in C.. "" is a pointer to an empty
- null-terminated string (ie, a pointer to a 0-byte). The statement above is
- trying to set the address of the first byte of your char array to point to this
- string. It's not how you clear a string (any my compiler refuses to compile
- this line!).
-
- To empty your string, try:
-
- name[0] = 0;
-
- That'll set the first byte of the string to be a character 0. This is the
- string termination byte and so it effectively means the string is now
- 0-length/empty.
-
- .\dam. [Team AMIGA] //\ ad32@brighton.ac.uk \\/
-
-